<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="sb" uri="/struts-bootstrap-tags"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<s:include value="/WEB-INF/content/common/header.jsp"></s:include>
</head>

<body class="bg">

	<s:include value="/WEB-INF/content/common/title-head.jsp"></s:include>

	<div class="content">
		<s:include value="/WEB-INF/content/common/tab.jsp"></s:include>
		<script>
			$("#settingTab").addClass("active");
		</script>
		<div class="body">
			<s:url action="list" namespace="/switches" var="switchSettingsUrl" />
			<s:url action="list" namespace="/controller"
				var="controllerSettingUrl" />
			<ul class="breadcrumb">
				<li><s:a href="%{#switchSettingsUrl}">
						<s:text name="global.menu.setting" />
					</s:a><span class="divider">&gt;</span></li>
				<li class="active"><s:text name="global.menu.setting.switch" /></li>
			</ul>

			<div class="row">
				<div class="span4">
					<h3>
						<s:text name="page.heading.list" />
					</h3>
					<ul class="nav nav-tabs">
						<li class="active"><s:a href="%{#switchSettingsUrl}">
								<s:text name="global.menu.setting.switch" />
							</s:a></li>
						<li><s:a href="%{#controllerSettingUrl}">
								<s:text name="global.menu.setting.controller" />
							</s:a></li>

					</ul>
					<div class="body">
						<ul class="unstyled">
							<li class="connect"><s:url action="view"
									namespace="/switchPanel" var="switchPanelViewUrl"
									includeParams="none">
									<s:param name="id" value="%{panelId}" />
								</s:url> <sj:a href="%{#switchPanelViewUrl}" targets="targetDiv">
									<s:text name="switch.connection" />
								</sj:a></li>

							<s:iterator value="switchList" status="rowIndex">
								<li class="switch"><s:url action="view"
										namespace="/switches" var="switchViewUrl" includeParams="none">
										<s:param name="id" value="%{id}" />
									</s:url> <sj:a href="%{#switchViewUrl}" targets="targetDiv">
										<s:property value="name" />
									</sj:a></li>
							</s:iterator>
						</ul>
					</div>
				</div>
				<div class="span7">
					<div id="targetDiv">
						<s:if test="actionMessage != null">
							<s:if test="panelId != null">
								<s:url action="view" namespace="/switchPanel"
									var="switchPanelViewUrl" includeParams="none" escapeAmp="false">
									<s:param name="id" value="%{panelId}" />
									<s:param name="actionMessage" value="%{actionMessage}" />
								</s:url>
								<sj:div href="%{switchPanelViewUrl}" />
							</s:if>
							<s:else>
								<s:url action="view" namespace="/switches"
									var="switchViewUrl" includeParams="none" escapeAmp="false">
									<s:param name="id" value="%{id}" />
									<s:param name="actionMessage" value="%{actionMessage}" />
								</s:url>
								<sj:div href="%{switchViewUrl}" />
							</s:else>

						</s:if>
						<s:elseif test="actionError != null">
							<s:if test="panelId != null">
								<s:url action="edit" namespace="/switchPanel"
									var="switchPanelViewUrl" includeParams="none" escapeAmp="false">
									<s:param name="id" value="%{panelId}" />
									<s:param name="actionError" value="%{actionError}" />
								</s:url>
								<sj:div href="%{switchPanelViewUrl}" />
							</s:if>
							<s:else>
								<s:url action="edit" namespace="/switches"
									var="switchViewUrl" includeParams="none" escapeAmp="false">
									<s:param name="id" value="%{id}" />
									<s:param name="actionError" value="%{actionError}" />
								</s:url>
								<sj:div href="%{switchViewUrl}" />
							</s:else>
						</s:elseif>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div id="footer">
		<s:include value="/WEB-INF/content/common/footer.jsp"></s:include>
	</div>
</body>
</html>